<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    table.table_box{
      width: 100%;
      border-collapse: collapse;
      border: 1px solid #666666;
      text-align: center;
    }
    table.table_box th,
    table.table_box td{
      border: 1px solid #666666;
      height: 38px;
    }
  </style>
</head>

<body>
  <div>
    <a href="/students/add">添加学生</a>
  </div>
  <table class="table_box">
    <thead>
      <tr>
        <th>序号</th>
        <th>性别</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>爱好</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      {{each students as value index}}
      <tr>
        <th>{{ index + 1}}</th>
        <th>{{ value.name }}</th>
        <th>{{ value.gender == 0 ? '女' : '男' }}</th>
        <th>{{ value.age }}</th>
        <th>{{ value.hobbies }}</th>
        <td>
          <a href="/students/edit?id={{ value.id }}">编辑</a>
          <a href="/students/del?id={{ value.id }}">删除</a>
        </td>
      </tr>
      {{/each}}
    </tbody>
  </table>
</body>

</html>